﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Diagnostics;
using System.Activities;

namespace Wicresoft.Platform.Workflows.Mobile.Tasks
{
    public sealed class LaunchClientProcess : ITask
    {
        public void Execute(Wicresoft_Platform_Processes_Mobile wppMobile, ActivityContext context)
        {
            Debug.Assert(wppMobile != null, "wppMobile cannot be null");

            using (MobileEntities db = new MobileEntities(true))
            {
                wppMobile.Id = context.WorkflowInstanceId;

                db.Wicresoft_Platform_Processes_Mobile.AddObject(wppMobile);
                db.SaveChanges();
            }
        }
    }
}
